﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace _5._6._2015CSharpDay08FullCRUDSingleton.Models
{
    public class DB
    {
        public List<Movie> Movies
        { get; set; }

        private DB() { }

        private static DB instance;

        public static DB Instance
        {
            get
            {
                return instance ??
                    (instance = new DB()
                  {
                      Movies = new List<Movie>()
                      {
                      new Movie() {Id = 1, Title = "First Movie", MovieUrl = "https://www.youtube.com/embed/pNYFpTLazvA", Genre = MovieGenre.Music},
                      new Movie() {Id = 2, Title = "Second Movie", MovieUrl = "https://www.youtube.com/embed/CrdZS0s3sp8", Genre = MovieGenre.Food},
                      new Movie(){Id = 3, Title = "Obey the Beard", MovieUrl ="https://www.youtube.com/embed/q0kSuZFOwFE", Genre = MovieGenre.Kittens},
                      new Movie(){Id = 4, Title = "Awesomeness", MovieUrl ="https://www.youtube.com/embed/ucDQlnvU5FM", Genre = MovieGenre.Music},
                      new Movie(){Id = 5, Title = "Bright Side of Life", MovieUrl = "https://www.youtube.com/embed/SJUhlRoBL8M", Genre = MovieGenre.Music},
                      new Movie(){Id = 6, Title = "Danger Zone", MovieUrl = "https://www.youtube.com/embed/MY5SLdM74EU", Genre = MovieGenre.Aliens}
                      }
                      });
                  }
            set
            {
                instance = value;
            }
        }
    }
}

